mmc: poll eMMC status after EXT_CSD command
authorHaojian Zhuang <[email protected]>
Wed, 21 Nov 2018 01:19:49 +0000 (09:19 +0800)
committerHaojian Zhuang <[email protected]>
Mon, 26 Nov 2018 01:20:23 +0000 (09:20 +0800)
EXT_CSD command needs to access data from eMMC device. Add the
operation of polling eMMC device status. Make sure the command is
finished.

Signed-off-by: Haojian Zhuang <[email protected]>
drivers/mmc/mmc.c

index 418ab1127aca8561c64ed528742796e8ca9b60c2..02bf770e559e40c01b869217904317c7b14e2129 100644 (file)
@@ -246,6 +246,13 @@ static int mmc_fill_device_info(void)
                        return ret;
                }
 
+               do {
+                       ret = mmc_device_state();
+                       if (ret < 0) {
+                               return ret;
+                       }
+               } while (ret != MMC_STATE_TRAN);
+
                nb_blocks = (mmc_ext_csd[CMD_EXTCSD_SEC_CNT] << 0) |
                            (mmc_ext_csd[CMD_EXTCSD_SEC_CNT + 1] << 8) |
                            (mmc_ext_csd[CMD_EXTCSD_SEC_CNT + 2] << 16) |